 |
|
 |
Subject: Error in Code |
 |
 |
 |
Product Area: Administration |
 |
Technical Area: Application Development |
 |
Platform: ALL |
 |
Release: 8.5.2 |
 |
Reproducible: Always |
 |
 |
 |
 |
Hi All,
Pls help in my case. I have form to be filled by the users and a file to be attached when they browse the path. To achieve this, have created a button for "Browse" and then created a submit button which runs the agent. But rtitem is empty and due to that, getting error that "Instance Member embed...does not exist. Understood that rtitem has values and the input is stored in the value(0). Confused how to proceed. Pls help.
*****************Browse Button****************
Sub Click(Source As Button)
Dim s As New NotesSession
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Set uidoc = ws.CurrentDocument
Start:
filename = ws.OpenFileDialog( False, "Select upload file.", "", "D:\Program Files\IBM\Lotus\Notes\")
If Isempty(filename) Then
Msgbox "File is Empty"
Goto Start
End If
If Cstr(filename(0))="" Then
Msgbox "File is Not Avilable"
Goto Start
End If
Call uidoc.FieldSetText ("IdFile", Cstr(filename(0)))
Set filesys = CreateObject("Scripting.FileSystemObject")
path = filesys.GetAbsolutePathName(filename(0))
FileName = filesys.GetFileName(path)
FullPath = Replace ( path, FileName, "")
Call uidoc.FieldSetText ("FullPath", Cstr(FullPath))
Call uidoc.FieldSetText ("FileName", Cstr(FileName))
End Sub
*********************************************
***************Submit************************
Sub Initialize
Dim s As New NotesSession
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim filesys,FullPath,OUName,FileName,Path
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim Object As NotesEmbeddedObject
Dim rtitem As Variant
Set uidoc = ws.CurrentDocument
OUName = uidoc.FieldGetText( "OUName" )
FileName = uidoc.FieldGetText( "FileName" )
Set doc = uidoc.document
Dim FullPath1 As variant
'FullPath1 = doc.Getitemvalue("FullPath")
'FullPath = FullPath1(0)
Set rtitem = doc.GetFirstItem("FullPath")
Set Object = rtitem.EmbedObject(EMBED_ATTACHMENT,"",FileName,OUName)
Call doc.Save(True,True)
End Sub
**********************************************
 
Feedback number WEBB94VKME created by ~Howard Nimnukonygon on 02/13/2013

Status: Open
Comments:

Error in Code (~Howard Nimnuko... 13.Feb.13)
. . I think the field Fullpath is not a... (~Denise Lopnipl... 13.Feb.13)
. . . . Error in Code (~Howard Nimnuko... 14.Feb.13)
. . . . . . where is this code running?? (~Denise Lopnipl... 14.Feb.13)
. . . . . . . . Reply (~Howard Nimnuko... 14.Feb.13)
. . Try declaring rtitem as NotesRichTe... (~August Cispone... 13.Feb.13)
. . Fullpath not Filename (I think) (~Justin Chugero... 14.Feb.13)
. . . . Still, Problem exists (~Howard Nimnuko... 14.Feb.13)
. . . . . . code (~Denise Lopnipl... 14.Feb.13)
. . . . . . . . Thank You All...It is working.. (~Howard Nimnuko... 14.Feb.13)
. . . . . . . . . . You may want to clean up your code ... (~Dan Kikiterobu... 14.Feb.13)
. . . . . . . . . . . . Thank You Karl......... (~Howard Nimnuko... 15.Feb.13)
. . . . . . . . . . . . . . I am curious... (~Dan Kikiterobu... 15.Feb.13)
. . . . . . . . . . . . . . . . No (~Howard Nimnuko... 27.Mar.13) |
|  |
|